package com.hehe.controller;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ArticleRepository extends JpaRepository<T_article, Long> {

    // 按文章 ID 查询评论并分页 (倒序)
    Page<T_article> findByOrderByTitleDesc(Pageable pageable);

    // 按文章 ID 查询评论并分页 (正序)
    Page<T_article> findByOrderByTitleAsc(Pageable pageable);

    // Page<T_article_comments> findByArticleidOrderByCreatetime(Long articleid, Pageable pageable);

}



